<template>
  <div class="containt">
    <el-row>
      <el-col>
        退货商品
      </el-col></el-row>
    <el-table :border="true" :data="prop.tableInfo" :header-row-style="()=>{return {fontWeight:600}}">
      <el-table-column label="退货图片" prop="productPic" align="center">
        <template #default="scope">
          <el-image :src="scope.row.productPic" style="width:85px;height: 85px;"></el-image>
        </template>
      </el-table-column>
      <el-table-column label="商品名称" align="center">
        <template #default="scoped">
          <div>{{ scoped.row.productName }}</div>
          <div>品牌:{{ scoped.row.productBrand }}</div>
        </template>
      </el-table-column>
      <el-table-column label="价格/货号" align="center">
        <template #default="scoped">
          <div>价格:￥{{ scoped.row.productRealPrice }}</div>
          <div>货号:{{ scoped.row.productId }}</div>
        </template>
      </el-table-column>
      <el-table-column label="属性" align="center">
        <template #default="scoped">
          <div>{{ scoped.row.productAttr }}</div>
        </template>
      </el-table-column>
      <el-table-column label="数量" prop="productCount" align="center"></el-table-column>
      <el-table-column label="小计" align="center">
        <template #default="scoped">
          ￥{{ scoped.row.productRealPrice * scoped.row.productCount }}
        </template>
      </el-table-column>
    </el-table>
    <el-row justify="end">
      <el-col :span="2" style="min-width: 150px;">合计:<span style="color:#f56c6c">￥{{ totalPrice }}</span></el-col>
    </el-row>
  </div>
</template>
<script setup lang="ts">
import { computed } from 'vue';
let prop = defineProps<{
  tableInfo:any
}>()

const totalPrice = computed(()=>{
  return prop.tableInfo.reduce((pre,current)=>{
    return pre+current.productRealPrice;
  },0)
})
</script>
<style scoped>
.containt{
  width: calc(100% - 42px);
  padding: 20px;
  border: 1px solid #ccc;
}
.el-col{
  margin: 10px 0;
}
.table-head{
  font-weight: 600;
  color: #f56c6c;
}
</style>